<template>
	<view class="qrcode-box">
		<view class="u-flex u-flex-center u-flex-items-center u-m-t-60">
			<!-- <canvas id="qrcode" width="120" height="120"></canvas> -->
			<up-qrcode :showLoading="false" :size="120"
				:val="`https://hcimg.wq-info.com/enterprise?entId=${userInfoData.entId}&entName=${userInfoData.entName}&roleName=${userInfoData.newRoleName}&roleKey=${userInfoData.newRoleId}&name=${userInfoData.name}&userId=${userInfoData.userId}`"></up-qrcode>
		</view>
		<view class="text-center f-s-14 u-m-t-60">单位名称：{{ entName }}</view>
		<view class="text-center u-m-t-16 f-s-12 u-info">通过扫描上面的二维码进行</view>
		<view class="text-center u-m-t-8 f-s-12 u-info">单位成员注册或其他企业相关操作</view>

		<up-button text="知道了" :customStyle="{
			width: '500rpx',
			height: '80rpx',
			background: '#1677FF',
			borderRadius: '16rpx',
			fontSize: '28rpx',
			color: '#FFFFFF',
			marginTop: '40rpx'
		}" @click="know"></up-button>
	</view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue';
  import storage from "../utils/storage";
	const entId = ref('')
	const entName = ref('')

  const userInfoData = storage.get('user_info');
 console.log('jkhkjshdsvvvv')
  console.log(userInfoData)
  if(Object.keys(userInfoData).length<4){
    userInfoData.entId='test'
    userInfoData.entName='test'
    userInfoData.newRoleName='test'
    userInfoData.newRoleId='test'
    userInfoData.name='test'
    userInfoData.userId='test'

  }
	onLoad((options) => {
		entId.value = options.id
		entName.value = options.name
	})
	
	const know = ()=>{
		uni.switchTab({
			url: '/pages/index'
		})
	}
</script>

<style scoped lang="scss">
	.qrcode-box {
		padding: 32rpx 32rpx 34rpx;
		box-sizing: border-box;
	}
</style>